<gm:page title="My App" authenticate="false" onunload="clearList('modifiedSource')>

  <script type="text/javascript"> 
    
    
function showTruncatedTitles() {
      var originalSourceList = google.mashups.getObjectById('userPublicFeed');
      var modifiedSourceList = google.mashups.getObjectById('modifiedSource');
      var titleGPath = new GPath('atom:link[@rel='alternate']/@href/');
      
      clearList('modifiedSource');
    
    
      for (var i=0; i < originalSourceList.getData().size(); i++) {
        var entry = originalSourceList.getData().entryAt(i);
        var originalTitle = titleGPath.getValue(entry);
        var modifiedTitle = convertToAlbumFeed(originalTitle);
        titleGPath.setValue(entry, modifiedTitle);
        
        modifiedSourceList.getData().addEntry(entry);
      }
    }
    function clearList(listName) {
      var list = google.mashups.getObjectById(listName);
      
      for (var i=list.getData().size()-1; i>=0; i-=1) {
        list.getData().removeEntry(list.getData().entryAt(i));
      }
    }    
    
    
    function convertToAlbumFeed(userPublicFeedAtomRef){
      var feedElements = userPublicFeedAtomRef.split("/");
      var pre = "http://picasaweb.google.com/data/feed/base/user/";
      var user = feedElements[3];
      var then = "/album/";
      var album = feedElements[4];
      alert(pre + user + then + album);
      
      }
      
  
    //  http://picasaweb.google.com/data/feed/base/user/MichaelEONeal
  </script>
    
  convert("http://picasaweb.google.com/MichaelEONeal/BHRStartPhoto")
  
  <button onclick="convertToAlbumFeed('http://picasaweb.google.com/MichaelEONeal/BHRStartPhoto')">Click Me!</button>
  <input name=user>Picasa user name.</input>
  <br>
  <gm:list id="userPublicFeed" data="http://picasaweb.google.com/data/feed/base/user/MichaelEONeal" template="albumsTemplate">
    
  <gm:template id="albumsTemplate">
    <table style="width: 100%">
      <tr repeat="true">
        <td>
          <gm:text ref="atom:link[@rel='alternate']/@href/">
         
        </td>
      </tr>
    </table>
  </gm:template>
  
  
<div>
  <h4>Modified</h4>
  <gm:list id="modifiedSource" data="${tmp}/test"/>
  </div>  
</gm:page>